<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<head th:replace="top::html">
</head>

<body class="fixed hold-transition skin-blue">
    <div class="wrapper">
        <div th:replace="tophtml::html"></div>
        <div th:replace="left::html"></div>
        <div class="content-wrapper">
            <section class="content-header">
                <h1>
                    <span>需求已匹配项目列表</span>
                    <small></small>
                </h1>
                <ol class="breadcrumb">
                	<li th:replace="/project/showDemandMatchedProject :: section.content-header/ol/li"></li>
                    <li th:if="${customerId}"><a th:href="@{'/demand/showProjectButtDetail?pid='+${demand.pid}+'&customerId='+${customerId}}">需求已匹配项目列表</a></li>
                    <li th:unless="${customerId}"><a th:href="@{'/demand/showProjectButtDetail?pid='+${demand.pid}}">需求已匹配项目列表</a></li>
                </ol>
            </section>
            <section class="content container-fluid">
                <form th:action="@{${showButtDetailUrl}}" method="get" id="from1">
                    <input type="hidden" name="pageNo" id="pageNo" />
                    <input type="hidden" name="pid" th:value="${demand.pid}" />
                    <div class="form-group">
                        <select class="form-control" name="buttSta">
                            <option value="">--根据状态筛选--</option>
                            <option th:each="list : ${buttStatusList}" th:value="${list.names}" th:text="${list.worth}" th:selected="${list.names == buttSta}"></option>
                        </select>
                    </div>
                </form>
                <div class="box">
                    <div class="box-body">
                        <table id="person" class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>对接介绍</th>
                                    <th>负责人</th>
                                    <th>对接时间</th>
                                    <th>对接状态</th>
                                    <th>对接详情</th>
                                    <th>对接附件</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr th:each="dpi : ${pageInfo.list}" th:with="isUndo=${#lists.contains(undoButtIdList, dpi.pid)}">
                                    <td style="width:30%">
                                        <p th:text="${dpi.projectName}"></p>
                                        <p th:text="${dpi.expertName}"></p>
                                        <p th:text="${dpi.demandName}"></p>
                                    </td>
                                    <td th:text="${dpi.buttName}"></td>
                                    <td th:text="${dpi.buttDataTime}"></td>
                                    <td th:text="${dpi.buttStatusWorth}">沟通对接需求11</td>
                                    <td style="width:25%">
                                        <div class="col-md-3" style="width:100%;font-size: 14px;">
                                            <div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
                                                <div class="box-header with-border">
                                                    <span th:if="${#strings.length(dpi.buttDetails)>30}">
                                                        <span th:text="${#strings.substring(dpi.buttDetails,0,20)+'......'}"></span>
                                                    </span>
                                                    <span th:unless="${#strings.length(dpi.buttDetails)>30}">
                                                        <span th:text="${dpi.buttDetails}"></span>
                                                    </span>
                                                    <div class="box-tools pull-right" th:if="${#strings.length(dpi.buttDetails)>30}">
                                                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                                                            <i class="fa fa-plus"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div class="box-body">
                                                    <span th:text="${dpi.buttDetails}"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </td>
                                    <td>
                                        <a th:if="${dpi.buttaNnex}" th:href="@{'/details/download?fileName='+${dpi.buttaNnex}}">对接附件</a>
                                    </td>
                                    <td>
                                        <a th:if="${customerId}" th:href="@{'/details/showDemandMatchProjectAddButt?detailPid='+${dpi.pid}+'&customerId='+${customerId}}">更新对接详情</a>
                                        <a th:unless="${customerId}" th:href="@{'/details/showDemandMatchProjectAddButt?detailPid='+${dpi.pid}}">更新对接详情</a>
                                        |<a th:if="${customerId}" th:href="@{'/details/showDemandMatchProjectHistoryButts?buttdetails='+${dpi.pid}+'&pid='+${demand.pid}+'&customerId='+${customerId}}">查看历史详情</a>
                                        <a th:unless="${customerId}" th:href="@{'/details/showDemandMatchProjectHistoryButts?buttdetails='+${dpi.pid}+'&pid='+${demand.pid}}">查看历史详情</a>
                                        <span th:if="${isUndo}">|</span>
                                        <a th:if="${customerId} and ${isUndo}" th:href="@{'/demand/deleteProjectButt?buttId='+${dpi.pid}+'&pid='+${demand.pid}+'&customerId='+${customerId}+'&buttSta='+${buttSta}}">撤销匹配</a>
                                        <a th:if="${#strings.isEmpty(customerId)} and ${isUndo}" th:href="@{'/demand/deleteProjectButt?buttId='+${dpi.pid}+'&pid='+${demand.pid}+'&buttSta='+${buttSta}}">撤销匹配</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div th:replace="page::html"></div>
                    </div>
                </div>
            </section>
        </div>
        <div th:replace="footer::html"></div>
        <div class="control-sidebar-bg"></div>
    </div>
    <div th:replace="bottom::html"></div>
    <script type="text/javascript">
        $("select[name=buttSta]").change(function() {
            $("#from1").submit();
        });
    </script>
</body>

</html>